<html>
<head><meta charset="utf-8"><title>Stability guarantees of custom target specifications · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Stability.20guarantees.20of.20custom.20target.20specifications.html">Stability guarantees of custom target specifications</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="193601813"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Stability%20guarantees%20of%20custom%20target%20specifications/near/193601813" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Stability.20guarantees.20of.20custom.20target.20specifications.html#193601813">(Apr 10 2020 at 18:30)</a>:</h4>
<p>Reminder: custom target specification is a target platform description similar to those in <code>src\librustc_target\spec</code>, but passed dynamically as a json file using <code>rustc --target=my_target.json</code>.</p>
<p>The <code>--target</code> option with a file argument is available on stable Rust, so it would be reasonable to expect that stability of the target spec format is controlled by some policy.<br>
However, I haven't seen this mentioned anywhere (not in <a href="https://github.com/rust-lang/rfcs/blob/master/text/1122-language-semver.md" title="https://github.com/rust-lang/rfcs/blob/master/text/1122-language-semver.md">https://github.com/rust-lang/rfcs/blob/master/text/1122-language-semver.md</a> in particular), except for some people in chats occasionally.</p>
<p>In practice, new fields are added to the target specification very liberally without any official approval and are usually treated as implementation details.<br>
I've seen fields removed as well, but that happens very rarely.</p>
<p>I'm bringing this up because I want to add a few new field related to linker behavior, and migrate some old linker-related fields to them (this may take multiple PRs/weeks/months), but the end state is not entirely clear until the migration is complete.<br>
I wonder if I should introduce some notion of "unstable" custom target spec options and emit an error if they are constructed from a json file on stable channel, or maybe that's an overkill.</p>



<a name="193603289"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Stability%20guarantees%20of%20custom%20target%20specifications/near/193603289" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Stability.20guarantees.20of.20custom.20target.20specifications.html#193603289">(Apr 10 2020 at 18:44)</a>:</h4>
<hr>
<p>Example of a PR removing some target spec fields - <a href="https://github.com/rust-lang/rust/pull/71001" title="https://github.com/rust-lang/rust/pull/71001">https://github.com/rust-lang/rust/pull/71001</a>.</p>



<a name="193603323"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Stability%20guarantees%20of%20custom%20target%20specifications/near/193603323" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Stability.20guarantees.20of.20custom.20target.20specifications.html#193603323">(Apr 10 2020 at 18:44)</a>:</h4>
<p>But those fields were added, like, two weeks ago <span aria-label="slight smile" class="emoji emoji-1f642" role="img" title="slight smile">:slight_smile:</span></p>



<a name="193605760"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Stability%20guarantees%20of%20custom%20target%20specifications/near/193605760" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Stability.20guarantees.20of.20custom.20target.20specifications.html#193605760">(Apr 10 2020 at 19:06)</a>:</h4>
<p>I think we've treated spec files as essentially unstable, you can't practically change things and use them on stable, right? Since you need to build at least core...</p>



<a name="193616648"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Stability%20guarantees%20of%20custom%20target%20specifications/near/193616648" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Stability.20guarantees.20of.20custom.20target.20specifications.html#193616648">(Apr 10 2020 at 20:54)</a>:</h4>
<p>I've always assumed they were unstable (which is what I was told a while back). Should we make the --target flag unstable when used with a json spec?</p>



<a name="193617590"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Stability%20guarantees%20of%20custom%20target%20specifications/near/193617590" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Stability.20guarantees.20of.20custom.20target.20specifications.html#193617590">(Apr 10 2020 at 21:05)</a>:</h4>
<p><span class="user-mention" data-user-id="143274">@Amanieu</span> Seems like a good idea to make it unstable; I've also always assumed it as unstable</p>



<a name="193617695"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Stability%20guarantees%20of%20custom%20target%20specifications/near/193617695" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Stability.20guarantees.20of.20custom.20target.20specifications.html#193617695">(Apr 10 2020 at 21:06)</a>:</h4>
<p>That seems reasonable, yes, though I imagine we'd want to phase it in similarly to -Zunstable-options a year or two back</p>



<a name="193617724"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Stability%20guarantees%20of%20custom%20target%20specifications/near/193617724" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Stability.20guarantees.20of.20custom.20target.20specifications.html#193617724">(Apr 10 2020 at 21:06)</a>:</h4>
<p>mostly so that people using it have some time to complain, and we can upstream their target files or at least know we're breaking people</p>



<a name="193617764"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Stability%20guarantees%20of%20custom%20target%20specifications/near/193617764" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Stability.20guarantees.20of.20custom.20target.20specifications.html#193617764">(Apr 10 2020 at 21:07)</a>:</h4>
<p><span class="user-mention" data-user-id="116122">@simulacrum</span> Sure; do you think you have the time to file an issue for this?</p>



<a name="193617779"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Stability%20guarantees%20of%20custom%20target%20specifications/near/193617779" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Stability.20guarantees.20of.20custom.20target.20specifications.html#193617779">(Apr 10 2020 at 21:07)</a>:</h4>
<p>Not right now no</p>



<a name="193617882"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Stability%20guarantees%20of%20custom%20target%20specifications/near/193617882" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Stability.20guarantees.20of.20custom.20target.20specifications.html#193617882">(Apr 10 2020 at 21:08)</a>:</h4>
<p>I can do so in an hour or two though</p>



<a name="193619175"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Stability%20guarantees%20of%20custom%20target%20specifications/near/193619175" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Stability.20guarantees.20of.20custom.20target.20specifications.html#193619175">(Apr 10 2020 at 21:22)</a>:</h4>
<p>Thanks!</p>



<a name="193625531"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Stability%20guarantees%20of%20custom%20target%20specifications/near/193625531" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Stability.20guarantees.20of.20custom.20target.20specifications.html#193625531">(Apr 10 2020 at 22:33)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/issues/71009" title="https://github.com/rust-lang/rust/issues/71009">https://github.com/rust-lang/rust/issues/71009</a></p>



<a name="193625758"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Stability%20guarantees%20of%20custom%20target%20specifications/near/193625758" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Stability.20guarantees.20of.20custom.20target.20specifications.html#193625758">(Apr 10 2020 at 22:35)</a>:</h4>
<blockquote>
<p>I think we've treated spec files as essentially unstable, you can't practically change things and use them on stable, right?</p>
</blockquote>



<a name="193626018"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Stability%20guarantees%20of%20custom%20target%20specifications/near/193626018" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Stability.20guarantees.20of.20custom.20target.20specifications.html#193626018">(Apr 10 2020 at 22:38)</a>:</h4>
<p>You can take an existing target and, for example, change only something affecting linking of dlls/executables.<br>
Something like e.g. linking <code>glibc</code> statically (disclaimer: I didn't try it). libcore and libstd are can be reused without changes as static libraries in this case.</p>



<a name="193626196"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Stability%20guarantees%20of%20custom%20target%20specifications/near/193626196" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Stability.20guarantees.20of.20custom.20target.20specifications.html#193626196">(Apr 10 2020 at 22:40)</a>:</h4>
<p>Well, I guess in practice people don't do that?<br>
I've heard people mostly tweak the target specs for embedded use cases where you have to rebuild everything anyway.</p>



<a name="193626391"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Stability%20guarantees%20of%20custom%20target%20specifications/near/193626391" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Stability.20guarantees.20of.20custom.20target.20specifications.html#193626391">(Apr 10 2020 at 22:42)</a>:</h4>
<p>Yes, its one of those things that are only de-facto unstable.</p>



<a name="193626416"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Stability%20guarantees%20of%20custom%20target%20specifications/near/193626416" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Stability.20guarantees.20of.20custom.20target.20specifications.html#193626416">(Apr 10 2020 at 22:43)</a>:</h4>
<p>Would be good to make it properly unstable (require -Zunstable-options).</p>



<a name="193626852"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Stability%20guarantees%20of%20custom%20target%20specifications/near/193626852" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Stability.20guarantees.20of.20custom.20target.20specifications.html#193626852">(Apr 10 2020 at 22:48)</a>:</h4>
<p>Posted it to #rust-embedded:<a href="http://matrix.org" title="http://matrix.org">matrix.org</a> just to let people know</p>



<a name="193626920"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Stability%20guarantees%20of%20custom%20target%20specifications/near/193626920" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Stability.20guarantees.20of.20custom.20target.20specifications.html#193626920">(Apr 10 2020 at 22:49)</a>:</h4>
<blockquote>
<p>#rust-emdedded:<a href="http://matrix.org" title="http://matrix.org">matrix.org</a> does not exist.</p>
<p>This room doesn't exist. Are you sure you're at the right place?</p>
</blockquote>



<a name="193626925"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Stability%20guarantees%20of%20custom%20target%20specifications/near/193626925" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Stability.20guarantees.20of.20custom.20target.20specifications.html#193626925">(Apr 10 2020 at 22:49)</a>:</h4>
<p>(I see the typo tho)</p>



<a name="193627056"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Stability%20guarantees%20of%20custom%20target%20specifications/near/193627056" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Stability.20guarantees.20of.20custom.20target.20specifications.html#193627056">(Apr 10 2020 at 22:51)</a>:</h4>
<p>emdedded hehe</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>